@extends('Admin.layout.layout')
@section('title','分类修改')
@section('weizhi','分类修改')
@section('con')
<!-- {{session('error')}} -->
	
	@if (count($errors) > 0)
	    <div class="alert alert-danger">
	        <ul>
	            @foreach ($errors->all() as $error)
	                <li>{{ $error }}</li>
	            @endforeach
	        </ul>
	    </div>
	@endif

<div class="row">
    <div class="col-lg-6 col-lg-offset-2">
        <div class="panel panel-default">
            <div class="panel-body">
                <div class="row">
                    <div class="col-lg-12">
                        <form role="form" action="{{url('/admin/cate/update')}}" method="post">
                            <div class="form-group">
                                <label>选择所属分类</label>
                                <select name="pid" class="form-control">
                                    <option value="0">顶级分类</option>
                                @foreach($cates as $k=>$v)
                                    @if($v->id == $catesinfo->pid)
                                        <option value="{{$v->id}}" selected="selected">{{$v->title}}</option>
                                    @else
                                        <option value="{{$v->id}}">{{$v->title}}</option>
                                    @endif
                                @endforeach
                                </select>
                            </div>    
                        
                            <div class="form-group">
                                <label>分类名</label>
                                <input class="form-control" type="text" name="title" value="{{$catesinfo->title}}">
                            </div>

                            <label>状态 
                                <select name="status" aria-controls="dataTables-example" class="form-control input-sm">
                                    <option value="0">激活</option>
                                    <option value="1">未激活</option>
                                </select>
                            </label>
                            
                            <input type="hidden" name="id" value="{{$catesinfo->id}}">
                            <input type="hidden" name="yid" value="{{$catesinfo->pid}}">
                            
                          
                            {{csrf_field()}}
                            <button class="btn btn-primary btn-lg btn-block">修改</button>
                        </form>
                    </div>
                </div>
                <!-- /.row (nested) -->
            </div>
            <!-- /.panel-body -->
        </div>
        <!-- /.panel -->
    </div>
    <!-- /.col-lg-12 -->
</div>

@endsection